<template>
  <div class="app-container">
    <pageHeader></pageHeader>
    <div style="width: 1200px;margin: 0 auto;">
      <div style="display: flex;">
        <div class="menuSelect" @click="btnBack()">首页</div>
        <div style="margin-left: 30px;" :class="active == 0 ? 'menuSelected' : 'menuSelect'"
          @click="radioTypeChange(0)">
          年检记录
        </div>
        <div style="margin-left: 30px;" :class="active == 1 ? 'menuSelected' : 'menuSelect'"
          @click="radioTypeChange(1)">
          年检信息
        </div>
        <div style="margin-left: 30px;" :class="active == 2 ? 'menuSelected' : 'menuSelect'"
          @click="radioTypeChange(2)">
          印章信息维护
        </div>
      </div>
      <el-row>
        <el-col :span="24" style="line-height: 60px;">当前位置：&ensp;首页&ensp; > &ensp;<span style="color: #0c7cff;">{{
          active == 0 ? '年检记录' : active == 1 ? '年检信息' : '签章信息维护' }}</span>
        </el-col>
      </el-row>
      <div>
        <el-card class="box-card" v-if="active == 0">
          <div slot="header" class="clearfix">
            <el-row style="margin-bottom: 20px;">
              <el-col :span="16" style="padding-top: 13px;">
                <span>{{ userName }}-年检记录</span>
              </el-col>
              <el-col :span="8" style="text-align: right;">
                <el-popover
                  placement="left"
                  :width="420"
                  trigger="hover"
                >
                  <template #reference>
                    <img src="https://www.yyqygc.com:9000/file/asset/ykbwxcode.jpg" style="width: 30px;height: 30px;"></img>
                  </template>
                  <el-row>
                    <el-col :span="24" style="text-align: center;">
                      <span style="font-size: 18px;">系统问题请加微信群，工作人员在线指导。</span>
                    </el-col>
                    <el-col :span="24" style="text-align: center;margin-top: 20px;margin-bottom: 20px;">
                      <img src="https://www.yyqygc.com:9000/file/asset/ykbwxcode.jpg" style="width: 300px;height: 300px;"></img>
                    </el-col>
                  </el-row>
                </el-popover>
              </el-col>
            </el-row>
          </div>
          <el-table :header-cell-style="{ background: '#F0F5FA', color: '#333333' }" :data="yearListApprove" border
            style="width: 100%">
            <el-table-column type="index" label="序号" align="center" width="60" />
            <el-table-column prop="organizationBaseName" label="单位名称" align="center" width="170"/>
            <el-table-column prop="supervisoryUnit" label="主管单位" align="center" />
            <el-table-column prop="organizationType" label="组织类型" align="center">
              <template #default="scope">
                <span v-if="scope.row.organizationType == 0">民办非企业</span>
                <span v-if="scope.row.organizationType == 2">民办非企业</span>
                <span v-if="scope.row.organizationType == 1">社会团体</span>
              </template>
            </el-table-column>
            <el-table-column prop="examineYear" label="年检年份" align="center" width="90"/>
            <el-table-column prop="approveStatus" label="年检结果" align="center" width="100">
              <template #default="scope">
                <el-tag type="info" v-show="scope.row.approveStatus == ''">审批中</el-tag>
                <el-tag type="success" v-show="scope.row.approveStatus == 1">合格</el-tag>
                <el-tag type="warning" v-show="scope.row.approveStatus == 2">基本合格</el-tag>
                <el-tag type="danger" v-show="scope.row.approveStatus == 3">不合格</el-tag>
              </template>
            </el-table-column>
            <el-table-column prop="creditCode" label="组织代码" align="center" width="130"/>
            <el-table-column prop="contactsName" label="法定代表人" align="center" />
            <el-table-column prop="registerAddress" label="注册地址" align="center" :show-overflow-tooltip="true"/>
            <el-table-column fixed="right" label="操作" align="center" width="160">
              <template #default="scope">
                <el-button @click="yearlyList(scope.row)" type="text" size="default">年检结果</el-button>
                <el-button :loading="exportLoadding" @click="exportData(scope.row)" type="text" size="default">资料导出</el-button>
              </template>
            </el-table-column>
          </el-table>

          <el-row style="margin-bottom: 20px;margin-top: 100px;">
            <el-col :span="12" style="padding-top: 13px;">
              <span>{{ userName }}-审核记录</span>
            </el-col>
            <el-col :span="12" style="text-align: right;">
              <el-button type="primary" :loading="updateLoadding" @click="handleStepClick(1)">
                <span>{{ approveLevel == '' || approveLevel == 0 ? '填写（修改）年检信息' : '查看年检信息' }}</span>
              </el-button>
              <el-button v-if="approveLevel == '' || approveLevel == 0" type="primary" @click="dataTest()">提交审核</el-button>
              <!--            <el-button type="primary" @click="postApprove()">提交审核</el-button>-->
              <!--            <el-button type="primary" :disabled="!associationState" @click="postApprove()">提交审核</el-button>-->
              <!--            <span style="color: red;margin-left: 20px;">*</span><span-->
              <!--            style="font-size: 14px;">校验通过以后，即可提交审核。</span>-->
            </el-col>
          </el-row>
          <el-row style="margin-bottom: 30px;">
            <el-col :span="24">
              <el-table :data="listApproval" border style="width: 100%"
                :header-cell-style="{ background: '#F0F5FA', color: '#333333' }">
                <el-table-column type="index" label="序号" align="center" width="80" />
                <el-table-column prop="organizationBaseName" label="组织名称" align="center" />
                <el-table-column prop="organizationType" label="组织类型" align="center">
                  <template #default="scope">
                    <span v-if="scope.row.organizationType == 0">民办非企业</span>
                    <span v-if="scope.row.organizationType == 2">民办非企业</span>
                    <span v-if="scope.row.organizationType == 1">社会团体</span>
                  </template>
                </el-table-column>
                <el-table-column prop="supervisoryUnit" label="业务主管单位" align="center" />
                <el-table-column prop="approveLevel" label="审批进度" align="center">
                  <template #default="scope">
                    <span v-show="scope.row.approveLevel == 1">申报</span>
                    <span v-show="scope.row.approveLevel == 2">校对</span>
                    <span v-show="scope.row.approveLevel == 3">主管单位管理员分发</span>
                    <span v-show="scope.row.approveLevel == 4">主经办人审批</span>
                    <span v-show="scope.row.approveLevel == 5">主科长审批</span>
                    <span v-show="scope.row.approveLevel == 6">主分管领导审批</span>
                    <span v-show="scope.row.approveLevel == 7">登记经办人审批</span>
                    <span v-show="scope.row.approveLevel == 8">登记科长审批</span>
                  </template>
                </el-table-column>
                <el-table-column prop="approveStatus" label="审核结果" align="center">
                  <template #default="scope">
                    <span v-show="scope.row.approveStatus == ''"></span>
                    <el-tag type="danger" v-show="scope.row.approveStatus == -1">不通过</el-tag>
                    <el-tag type="success" v-show="scope.row.approveStatus == 1">合格</el-tag>
                    <el-tag type="warning" v-show="scope.row.approveStatus == 2">基本合格</el-tag>
                    <el-tag type="danger" v-show="scope.row.approveStatus == 3">不合格</el-tag>
                  </template>
                </el-table-column>
                <el-table-column prop="examineYear" label="审查年份" align="center" />
                <el-table-column fixed="right" label="操作" align="center" width="160">
                  <template #default="scope">
                    <el-button @click="handlePzClick(scope.row.annotations)" type="text" size="default">批注</el-button>
                    <el-button v-if="scope.row.approveLevel != null && scope.row.approveLevel != ''" @click="approveInfoClick(scope.row)" type="text" size="default">审核进度</el-button>
                  </template>
                </el-table-column>
              </el-table>
            </el-col>
            <el-col :span="24">
              <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
                :limit.sync="queryParams.pageSize" @pagination="getListApprove()" />
            </el-col>
          </el-row>
        </el-card>
        <el-card class="box-card" v-if="active == 1">
          <el-row>
            <el-col :span="12">
              <el-divider content-position="left"><span class="divider-title" style="line-height: 60px;">{{ tableName
                  }}</span>
              </el-divider>
            </el-col>
            <el-col :span="12">
              <div style="text-align: right;width: 100%;margin-top: 5px;">
                <!--              <el-button @click="handleStepClick(0)">年检记录</el-button>-->
                <el-button @click="topPages">上一页</el-button>
                <el-button @click="nextPages">下一页</el-button>
                <el-button type="primary" v-if="approveLevel == 0 || approveLevel == ''" :loading="postLoading"
                  @click="tableSave">保存
                </el-button>
              </div>
            </el-col>
          </el-row>

          <el-col :span="24" v-show="radioType == 1">
            <el-row>
              <el-col :span="5">
                <el-menu :default-openeds="defaultOpeneds" @open="handleOpen" active-text-color="#333333"
                  text-color="#333333" background-color="#ffffff" default-active="0" :unique-opened="true">
                  <el-sub-menu index="0" @click="menuListClick(0, '基本信息')">
                    <template #title>
                      <span :class="tableCode == 0 ? 'selectedColor' : 'selectColor'">基本信息</span>
                    </template>
                  </el-sub-menu>
                  <el-sub-menu index="1" @click="menuListClick(1, '负责人名单')">
                    <template #title>
                      <span :class="tableCode == 1 ? 'selectedColor' : 'selectColor'">负责人名单</span>
                    </template>
                  </el-sub-menu>
                  <el-sub-menu index="2">
                    <template #title>
                      <span>内部建设情况</span>
                    </template>
                    <el-menu-item index="2" @click="menuListClick(2, '登记、备案事项变更情况')"><span
                        :class="tableCode == 2 ? 'selectedColor' : 'selectColor'">•&emsp;登记、备案事项变更情况</span>
                    </el-menu-item>
                    <el-menu-item index="3" @click="menuListClick(3, '会议及换届情况')"><span
                        :class="tableCode == 3 ? 'selectedColor' : 'selectColor'">•&emsp;会议及换届情况</span>
                    </el-menu-item>
                    <el-menu-item index="4" @click="menuListClick(4, '内部管理情况')"><span
                        :class="tableCode == 4 ? 'selectedColor' : 'selectColor'">•&emsp;内部管理情况</span>
                    </el-menu-item>
                    <el-menu-item index="5" @click="menuListClick(5, '机构设置情况')"><span
                        :class="tableCode == 5 ? 'selectedColor' : 'selectColor'">•&emsp;机构设置情况</span>
                    </el-menu-item>
                    <el-menu-item index="6" @click="menuListClick(6, '党建工作情况')"><span
                        :class="tableCode == 6 ? 'selectedColor' : 'selectColor'">•&emsp;党建工作情况</span>
                    </el-menu-item>
                  </el-sub-menu>
                  <el-sub-menu index="7">
                    <template #title>
                      <span>财务会计报告</span>
                    </template>
                    <el-menu-item index="7" @click="menuListClick(7, '资产负债表')"><span
                        :class="tableCode == 7 ? 'selectedColor' : 'selectColor'">•&emsp;资产负债表</span></el-menu-item>
                    <el-menu-item index="8" @click="menuListClick(8, '业务活动表')"><span
                        :class="tableCode == 8 ? 'selectedColor' : 'selectColor'">•&emsp;业务活动表</span></el-menu-item>
                    <el-menu-item index="9" @click="menuListClick(9, '现金流量表')"><span
                        :class="tableCode == 9 ? 'selectedColor' : 'selectColor'">•&emsp;现金流量表</span></el-menu-item>
                  </el-sub-menu>
                  <el-sub-menu index="10">
                    <template #title>
                      <span>业务活动情况</span>
                    </template>
                    <el-menu-item index="10" @click="menuListClick(10, '工作总结、计划')"><span
                        :class="tableCode == 10 ? 'selectedColor' : 'selectColor'">•&emsp;工作总结、计划</span>
                    </el-menu-item>
                    <el-menu-item index="11" @click="menuListClick(11, '收费与服务情况')"><span
                        :class="tableCode == 11 ? 'selectedColor' : 'selectColor'">•&emsp;收费与服务情况</span>
                    </el-menu-item>
                    <el-menu-item index="12" @click="menuListClick(12, '接受捐赠资助使用')"><span
                        :class="tableCode == 12 ? 'selectedColor' : 'selectColor'">•&emsp;接受捐赠资助使用</span>
                    </el-menu-item>
                    <el-menu-item index="13" @click="menuListClick(13, '公益慈善、支出、职能、事项')"><span
                        :class="tableCode == 13 ? 'selectedColor' : 'selectColor'">•&emsp;公益慈善、支出、职能、事项</span>
                    </el-menu-item>
                    <el-menu-item index="14" @click="menuListClick(14, '展览会、博览会、交易会、评比达标表彰活动')"><span
                        :class="tableCode == 14 ? 'selectedColor' : 'selectColor'">•&emsp;展览会、博览会、交易会、评比达标表彰活动</span>
                    </el-menu-item>
                  </el-sub-menu>
                  <el-sub-menu index="15">
                    <template #title>
                      <span>援藏、乡村振兴、成渝建设</span>
                    </template>
                    <el-menu-item index="15" @click="menuListClick(15, '支援西藏昌都、乡村振兴')"><span
                        :class="tableCode == 15 ? 'selectedColor' : 'selectColor'">•&emsp;支援西藏昌都、乡村振兴</span>
                    </el-menu-item>
                    <el-menu-item index="16" @click="menuListClick(16, '成渝经济圈建设')"><span
                        :class="tableCode == 16 ? 'selectedColor' : 'selectColor'">•&emsp;成渝经济圈建设</span>
                    </el-menu-item>
                  </el-sub-menu>
                  <el-sub-menu index="17" @click="menuListClick(17, '接受监督检查情况')">
                    <template #title>
                      <span :class="tableCode == 17 ? 'selectedColor' : 'selectColor'">接受监督检查情况</span>
                    </template>
                  </el-sub-menu>
                  <el-sub-menu index="18" @click="menuListClick(18, '其他需要说明的情况')">
                    <template #title>
                      <span :class="tableCode == 18 ? 'selectedColor' : 'selectColor'">其他需要说明的情况</span>
                    </template>
                  </el-sub-menu>
                  <el-sub-menu index="19" @click="menuListClick(19, '年检审核意见')">
                    <template #title>
                      <span :class="tableCode == 19 ? 'selectedColor' : 'selectColor'">年检审核意见</span>
                    </template>
                  </el-sub-menu>
                  <el-sub-menu index="20" @click="menuListClick(20, '承接政府购买情况')">
                    <template #title>
                      <span :class="tableCode == 20 ? 'selectedColor' : 'selectColor'">承接政府购买情况</span>
                    </template>
                  </el-sub-menu>
                  <el-sub-menu index="20" @click="menuListClick(21, '理事、监事情况')">
                    <template #title>
                      <span :class="tableCode == 21 ? 'selectedColor' : 'selectColor'">理事、监事情况</span>
                    </template>
                  </el-sub-menu>
                  <el-sub-menu index="21" @click="menuListClick(22, '附件材料')">
                    <template #title>
                      <span :class="tableCode == 22 ? 'selectedColor' : 'selectColor'">附件材料</span>
                    </template>
                  </el-sub-menu>
                </el-menu>
              </el-col>
              <el-col :span="19">
                <div style="overflow: auto;height: 64vh;padding-left: 10px;">
                  <el-row>
                    <el-col :span="24" v-show="tableCode == 0">
                      <sttable1 ref="sttable1" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 1">
                      <sttable2 ref="sttable2" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 2">
                      <sttable3 ref="sttable3" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 3">
                      <sttable4 ref="sttable4" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 4">
                      <sttable5 ref="sttable5" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 5">
                      <sttable6 ref="sttable6" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 6">
                      <sttable7 ref="sttable7" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 7">
                      <sttable8 ref="sttable8" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 8">
                      <sttable9 ref="sttable9" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 9">
                      <sttable10 ref="sttable10" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 10">
                      <sttable11 ref="sttable11" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 11">
                      <sttable12 ref="sttable12" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 12">
                      <sttable13 ref="sttable13" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 13">
                      <sttable14 ref="sttable14" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 14">
                      <sttable15 ref="sttable15" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 15">
                      <sttable16 ref="sttable16" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 16">
                      <sttable17 ref="sttable17" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 17">
                      <sttable18 ref="sttable18" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 18">
                      <sttable19 ref="sttable19" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 19">
                      <sttable20 ref="sttable20" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 20">
                      <sttable21 ref="sttable21" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 21">
                      <sttable23 ref="sttable23" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 22">
                      <sttable22 ref="sttable22" />
                    </el-col>
                  </el-row>
                </div>
              </el-col>
            </el-row>
          </el-col>
          <el-col :span="24" v-show="radioType == 2">
            <el-row>
              <el-col :span="5">
                <el-menu :default-openeds="defaultOpeneds" @open="handleOpen" active-text-color="#333333"
                  text-color="#333333" background-color="#ffffff" default-active="0" :unique-opened="true">
                  <el-sub-menu index="0">
                    <template #title>
                      <span>基本信息</span>
                    </template>
                    <el-menu-item index="0" @click="menuListClick(0, '基本信息')"><span
                        :class="tableCode == 0 ? 'selectedColor' : 'selectColor'">•&emsp;基本信息</span></el-menu-item>
                    <el-menu-item index="1" @click="menuListClick(1, '从业人员')"><span
                        :class="tableCode == 1 ? 'selectedColor' : 'selectColor'">•&emsp;从业人员</span></el-menu-item>
                    <el-menu-item index="2" @click="menuListClick(2, '负责人情况')"><span
                        :class="tableCode == 2 ? 'selectedColor' : 'selectColor'">•&emsp;负责任人情况</span>
                    </el-menu-item>
                    <el-menu-item index="3" @click="menuListClick(3, '理事会、监事成员情况')"><span
                        :class="tableCode == 3 ? 'selectedColor' : 'selectColor'">•&emsp;理事会、监事成员情况</span>
                    </el-menu-item>
                  </el-sub-menu>
                  <el-sub-menu index="4">
                    <template #title>
                      <span>内部建设情况</span>
                    </template>
                    <el-menu-item index="4" @click="menuListClick(4, '内设机构情况')"><span
                        :class="tableCode == 4 ? 'selectedColor' : 'selectColor'">•&emsp;内设机构情况</span>
                    </el-menu-item>
                    <el-menu-item index="5" @click="menuListClick(5, '内部管理情况')"><span
                        :class="tableCode == 5 ? 'selectedColor' : 'selectColor'">•&emsp;内部管理情况</span>
                    </el-menu-item>
                  </el-sub-menu>
                  <el-sub-menu index="6" @click="menuListClick(6, '接受监督检查情况')">
                    <template #title>
                      <span :class="tableCode == 6 ? 'selectedColor' : 'selectColor'">接受监督检查情况</span>
                    </template>
                  </el-sub-menu>
                  <el-sub-menu index="7">
                    <template #title>
                      <span>本年度开展活动情况</span>
                    </template>
                    <el-menu-item index="7" @click="menuListClick(7, '本行政区域内开展公益活动情况')"><span
                        :class="tableCode == 7 ? 'selectedColor' : 'selectColor'">•&emsp;本行政区域内开展公益活动情况</span>
                    </el-menu-item>
                    <el-menu-item index="8" @click="menuListClick(8, '承接政府委托职能、购买服务项目、政府补贴情况')"><span
                        :class="tableCode == 8 ? 'selectedColor' : 'selectColor'">•&emsp;承接政府委托职能、购买服务项目、政府补贴情况</span>
                    </el-menu-item>
                    <el-menu-item index="9" @click="menuListClick(9, '参加国际会议和出访情况、在境外设立机构情况')"><span
                        :class="tableCode == 9 ? 'selectedColor' : 'selectColor'">•&emsp;参加国际会议和出访情况、在境外设立机构情况</span>
                    </el-menu-item>
                    <el-menu-item index="10" @click="menuListClick(10, '对外交流合作、参加国际组织')"><span
                        :class="tableCode == 10 ? 'selectedColor' : 'selectColor'">•&emsp;对外交流合作、参加国际组织</span>
                    </el-menu-item>
                    <el-menu-item index="11" @click="menuListClick(11, '对外活动主要成绩、问题和管理政策建议')"><span
                        :class="tableCode == 11 ? 'selectedColor' : 'selectColor'">•&emsp;对外活动主要成绩、问题和管理政策建议</span>
                    </el-menu-item>
                    <el-menu-item index="12" @click="menuListClick(12, '举办刊物及活动情况')"><span
                        :class="tableCode == 12 ? 'selectedColor' : 'selectColor'">•&emsp;举办刊物及公益活动情况</span>
                    </el-menu-item>
                    <!--                  <el-menu-item index="12" @click="menuListClick(12,'举办研讨会、论坛活动情况')"><span>•&emsp;举办研讨会、论坛活动情况</span></el-menu-item>-->
                    <!--                  <el-menu-item index="12" @click="menuListClick(12,'举办评比达标表彰活动情况')"><span>•&emsp;举办评比达标表彰活动情况</span></el-menu-item>-->
                    <el-menu-item index="13" @click="menuListClick(13, '支援和计划支援西藏昌都建设、参与和计划乡村振兴工作情况')"><span
                        :class="tableCode == 13 ? 'selectedColor' : 'selectColor'">•&emsp;支援和计划支援西藏昌都建设、参与和计划乡村振兴工作情况</span>
                    </el-menu-item>
                    <el-menu-item index="14" @click="menuListClick(14, '参与和计划成渝地区双城经济圈建设情况')"><span
                        :class="tableCode == 14 ? 'selectedColor' : 'selectColor'">•&emsp;参与和计划成渝地区双城经济圈建设情况</span>
                    </el-menu-item>
                  </el-sub-menu>

                  <el-sub-menu index="15" @click="menuListClick(15, '年度工作报告')">
                    <template #title>
                      <span :class="tableCode == 15 ? 'selectedColor' : 'selectColor'">年度工作报告</span>
                    </template>
                  </el-sub-menu>
                  <el-sub-menu index="16" @click="menuListClick(16, '年检审核意见')">
                    <template #title>
                      <span :class="tableCode == 16 ? 'selectedColor' : 'selectColor'">年检审核意见</span>
                    </template>
                  </el-sub-menu>
                  <el-sub-menu index="17">
                    <template #title>
                      <span>财务情况报告</span>
                    </template>
                    <el-menu-item index="17" @click="menuListClick(17, '资产负债表')"><span
                        :class="tableCode == 17 ? 'selectedColor' : 'selectColor'">•&emsp;资产负债表</span></el-menu-item>
                    <el-menu-item index="18" @click="menuListClick(18, '业务活动表')"><span
                        :class="tableCode == 18 ? 'selectedColor' : 'selectColor'">•&emsp;业务活动表</span></el-menu-item>
                    <el-menu-item index="19" @click="menuListClick(19, '现金流表')"><span
                        :class="tableCode == 19 ? 'selectedColor' : 'selectColor'">•&emsp;现金流表</span></el-menu-item>
                    <el-menu-item index="20" @click="menuListClick(20, '接受捐赠资助情况和使用情况')"><span
                        :class="tableCode == 20 ? 'selectedColor' : 'selectColor'">•&emsp;接受捐赠资助情况和使用情况</span>
                    </el-menu-item>
                    <el-menu-item index="21" @click="menuListClick(21, '公益慈善活动支出')"><span
                        :class="tableCode == 21 ? 'selectedColor' : 'selectColor'">•&emsp;公益慈善活动支出</span>
                    </el-menu-item>
                  </el-sub-menu>
                  <el-sub-menu index="22" @click="menuListClick(22, '党建工作情况')">
                    <template #title>
                      <span :class="tableCode == 22 ? 'selectedColor' : 'selectColor'">党建工作情况</span>
                    </template>
                  </el-sub-menu>
                  <el-sub-menu index="23" @click="menuListClick(23, '上年度整改情况表')">
                    <template #title>
                      <span :class="tableCode == 23 ? 'selectedColor' : 'selectColor'">上年度整改情况表</span>
                    </template>
                  </el-sub-menu>

                  <el-sub-menu index="24" @click="menuListClick(24, '附件材料')">
                    <template #title>
                      <span :class="tableCode == 24 ? 'selectedColor' : 'selectColor'">附件材料</span>
                    </template>
                  </el-sub-menu>
                </el-menu>
              </el-col>
              <el-col :span="19">
                <div style="overflow: auto;height: 64vh;padding-left: 5px;">
                  <el-row>
                    <el-col :span="24" v-show="tableCode == 0">
                      <tablemf0 ref="tablemf0" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 1">
                      <tablemf1 ref="tablemf1" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 2">
                      <tablemf2 ref="tablemf2" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 3">
                      <tablemf3 ref="tablemf3" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 4">
                      <tablemf4 ref="tablemf4" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 5">
                      <tablemf5 ref="tablemf5" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 6">
                      <tablemf6 ref="tablemf6" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 7">
                      <tablemf7 ref="tablemf7" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 8">
                      <tablemf8 ref="tablemf8" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 9">
                      <tablemf9 ref="tablemf9" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 10">
                      <tablemf10 ref="tablemf10" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 11">
                      <tablemf11 ref="tablemf11" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 12">
                      <tablemf12 ref="tablemf12" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 13">
                      <tablemf19 ref="tablemf19" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 14">
                      <tablemf20 ref="tablemf20" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 15">
                      <tablemf13 ref="tablemf13" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 16">
                      <tablemf14 ref="tablemf14" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 17">
                      <tablemf15 ref="tablemf15" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 18">
                      <tablemf16 ref="tablemf16" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 19">
                      <tablemf17 ref="tablemf17" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 20">
                      <tablemf18 ref="tablemf18" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 21">
                      <tablemf21 ref="tablemf21" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 22">
                      <tablemf22 ref="tablemf22" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 23">
                      <tablemf23 ref="tablemf23" />
                    </el-col>
                    <el-col :span="24" v-show="tableCode == 24">
                      <tablemf24 ref="tablemf24" />
                    </el-col>
                  </el-row>
                </div>
              </el-col>
            </el-row>
          </el-col>
        </el-card>
        <el-card class="box-card" v-if="active == 2" style="min-height: 40vh;">
          <p style="color: red;" v-if="isAuthentication != 1">印章状态：{{mAuthenticationMessage}}</p>
          <p v-if="isAuthentication != 1" ><a href="https://seal-online.yysjzl.com:9180" target="_blank">https://seal-online.yysjzl.com:9180/</a></p>
          <el-form v-if="isAuthentication == 1" :model="signForm" ref="signRef" :rules="signRules" label-width="150px" size="default"
            label-position="right">
            <el-row>
              <el-col style="margin-bottom: 15px;" :span="23">
                <span style="font-size: 18px;font-weight: bold;line-height: 36px;">第一步：社会组织授权签章<span style="color:red;"
                    v-if="!sealSilentState">（未完成）</span><span style="color:green;"
                    v-if="sealSilentState">（已完成）</span></span>
              </el-col>
<!--              v-if="!sealSilentState"-->
<!--              <el-col :span="10" >-->
<!--                <el-input v-model="silentSeal.sealMultipleRequest.sealIds" placeholder="请输入印章编号">-->
<!--                  <template #prepend>印章编号</template>-->
<!--                </el-input>-->
<!--              </el-col>-->
<!--              v-if="!sealSilentState"-->
              <el-col :span="11">
                <el-input v-model="silentSeal.authUser.mobile" placeholder="请输入印章平台登录的手机号">
                  <template #prepend>签章平台手机号</template>
                </el-input>
              </el-col>
<!--              v-if="!sealSilentState"-->
              <el-col :span="4">
                <el-button type="primary" @click="companysignsilent()">开始授权</el-button>
              </el-col>
              <el-col style="margin-bottom: 15px;margin-top: 15px;" :span="23">
                <span style="font-size: 18px;font-weight: bold;line-height: 36px;">第二步：印章信息管理<span style="color:red;"
                    v-if="signForm.sealId == ''">（未完成）</span><span style="color:green;"
                    v-if="signForm.sealId != ''">（已完成）</span></span>
              </el-col>
              <el-col :span="11" style="margin-top: 15px;">
                <el-form-item prop="personName" label="负责人姓名">
                  <el-input placeholder="请输入" v-model="signForm.personName">
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8" style="margin-top: 15px;">
                <el-form-item prop="personContact" label="签章手机号">
                  <el-input placeholder="请输入" v-model="signForm.personContact">
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="3" style="margin-top: 15px;">
                <el-button type="primary" @click="getPersonId(signForm.personContact)">获取其他编号</el-button>
              </el-col>
              <el-col :span="11" style="margin-top: 15px;">
                <el-form-item prop="personId" label="负责人编号">
                  <el-input placeholder="请输入" disabled v-model="signForm.personId">
                  </el-input>
                </el-form-item>
              </el-col>

              <el-col :span="11" style="margin-top: 15px;">
                <el-form-item prop="signatorySealId" label="印章编号">
                  <el-input placeholder="请输入" disabled v-model="signForm.signatorySealId">
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="11" style="margin-top: 15px;" v-if="signForm.sealId == ''">
                <el-form-item prop="sealPassword" label="设置印章密码">
                  <el-input type="password" placeholder="请输入" v-model="signForm.sealPassword">
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="11" style="margin-top: 15px;">
                <el-form-item prop="sealPasswordOld" :label="signForm.sealId == '' ? '再次输入密码' : '原始密码'">
                  <el-input type="password" placeholder="请输入" v-model="signForm.sealPasswordOld">
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="11" style="margin-top: 15px;">
                <el-form-item prop="signatoryId" label="签署单位编号">
                  <el-input placeholder="请输入" disabled v-model="signForm.signatoryId">
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="11" style="margin-top: 15px;">
                <el-form-item prop="signatoryName" label="签署单位名称">
                  <el-input placeholder="请输入" v-model="signForm.signatoryName">
                  </el-input>
                </el-form-item>
              </el-col>
              <!--              <el-col :span="11" style="margin-top: 15px;">-->
              <!--                <el-form-item prop="categoryId" label="用章流程编号">-->
              <!--                  <el-input placeholder="请输入" v-model="signForm.categoryId">-->
              <!--                  </el-input>-->
              <!--                </el-form-item>-->
              <!--              </el-col>-->
              <!--              <el-col :span="11" style="margin-top: 15px;">-->
              <!--                <el-form-item prop="categoryName" label="用章流程名称">-->
              <!--                  <el-input placeholder="请输入" v-model="signForm.categoryName">-->
              <!--                  </el-input>-->
              <!--                </el-form-item>-->
              <!--              </el-col>-->
              <el-col :span="24" style="text-align: center;margin-top: 50px;">
                <el-button type="primary" @click="saveSign()">
                  {{ signForm.sealId == '' ? '保存印章信息' : '修改印章信息' }}
                </el-button>
              </el-col>
            </el-row>
          </el-form>
          <el-col v-if="isAuthentication == 1" style="margin-bottom: 15px;" :span="23">
            <span style="font-size: 18px;font-weight: bold;line-height: 36px;">第三步：封面签章<span style="color:red;"
                v-if="sealPdfUrl == ''">（未完成）</span><span style="color:green;"
                v-if="sealPdfUrl != ''">（已完成）</span></span>
          </el-col>
          <el-row v-if="isAuthentication == 1" style="margin-top: 20px;">

            <el-col :span="10">
              <el-input v-model="postSeal.personContact" placeholder="请输入电子签章平台手机号">
                <template #prepend>签章手机号</template>
              </el-input>
            </el-col>
            <el-col :span="10">
              <el-input type="password" v-model="postSeal.sealPassword" placeholder="请输入印章密码（第二步设置的那个）">
                <template #prepend>印章密码</template>
              </el-input>
            </el-col>
            <el-col :span="4">
              <el-button type="primary" @click="signInfo()">封面签章</el-button>
            </el-col>
            <el-col :span="24" style="text-align: center;">
              <div style="width: 700px;">
                <el-image :src="sealPdfUrl" fit="fill"></el-image>
              </div>
            </el-col>
          </el-row>
          <div  id="signCoverDiv" style="padding:15px;box-sizing: border-box;color: black;font-size: 16px;width: 750px;" v-if="isAuthentication == 1">
            <el-row>
              <el-col :span="24" style="text-align:center;margin-top: 20px;">
                <p v-if="userInfo != undefined" style="font-size: 22px;font-weight: bold;">
                  {{ userInfo.userName}}</p>
                <p style="font-size: 22px;font-weight: bold;">
                  {{ queryParams.examineYear}}年年度工作报告书</p>
              </el-col>
              <el-col :span="24">云阳县民政局：</el-col>
              <el-col :span="24">
                <p style="line-height: 30px;">
                  &emsp;&emsp;本社会团体根据《社会团体登记管理条例》、《民间非营利组织会计制度》等相关规定，编制{{ queryParams.examineYear
                  }}年年度工作报告书，保证内容真实、准确、完整，并承担由此引起的一切法律责任。</p>
              </el-col>
              <el-col :span="22" style="text-align: right;margin-top: 50px;">
                <p>（社会组织印章）</p>
              </el-col>
              <el-col :span="22" style="text-align: right;">
                <p>{{ nowDate }}</p>
              </el-col>
              <el-col :span="24" style="text-align: center;margin-top: 20px;">
                <p style="font-size: 18px;">法定代表人申明</p>
              </el-col>
              <el-col :span="24" style="text-align: center;">
                <p>本报告书情况属实，本人愿意承担由此引起的一切法律责任。</p>
              </el-col>
              <el-col :span="22" style="text-align: right;margin-top: 20px;margin-bottom: 20px;">
                <p>法定代表人签字：{{legalPerson}}</p>
              </el-col>
              <el-col :span="22" style="text-align: right;">
                <p style="margin-top: 0px;">{{ nowDate }}</p>
              </el-col>
            </el-row>
          </div>
        </el-card>
      </div>
    </div>
    <pageFooter></pageFooter>
    <el-dialog title="" v-model="yearlyDialog" width="600px" style="margin-top: 10px;" :show-close="false">
      <yearly-info :yearApprove="yearApprove" :userName="userName"></yearly-info>
      <div slot="footer">
      </div>
    </el-dialog>
    <el-dialog title="批注记录" v-model="pzDialog" width="40%">
      <el-timeline reverse="true">
        <el-timeline-item v-for="(list, index) in pzList" :key="index" :timestamp="list.lastModifiedTs">
          {{ list.description }}
        </el-timeline-item>
      </el-timeline>
    </el-dialog>
    <el-dialog title="校验结果" v-model="associationDialog" width="40%">
      <el-row>
        <el-col :span="24" style="text-align: center;"><span v-if="associationList.length == 0"
            style="color: green;">您的检验通过，请提交审核。</span>
        </el-col>
        <el-col :span="24" style="text-align: center;"><span v-if="associationList.length != 0"
            style="font-size: 18px;">您的检验存在问题，是否继续提交审核？</span>
        </el-col>
        <el-col :span="24" style="text-align: center;margin-top: 30px;">
          <el-button type="primary" @click="postApprove()">确认提交审核</el-button>
        </el-col>
      </el-row>
      <el-col v-if="associationList.length == 0" :span="24">
        <el-result icon="success" title="校验通过" subTitle="校验通过，请提交审核！">
          <template slot="extra">
          </template>
        </el-result>
      </el-col>
      <el-col v-if="associationList.length != 0" :span="24">
        <el-result title="校验未通过" subTitle="校验未通过，原因如下：">
          <template slot="extra">
          </template>
        </el-result>
      </el-col>
      <el-timeline reverse="true">
        <el-timeline-item v-for="(list, index) in associationList" :key="index" :timestamp="list.description">
          {{ list.pageNumber }}
        </el-timeline-item>
      </el-timeline>
    </el-dialog>
    <el-dialog title="审核进度" v-model="openPress" width="600px" append-to-body draggable destroy-on-close top="5vh">
      <checkStep :currentRow="chooseRow"></checkStep>
    </el-dialog>
  </div>
</template>
<script>

import md5 from 'js-md5'
import jsPDF from 'jspdf'
import db from '@/storage'
import html2canvas from 'html2canvas'
import { List, DocumentCopy, Promotion, Checked, Search } from '@element-plus/icons-vue'
import { stTreeData, mfTreeData } from './data.js'
import { ElMessage, ElMessageBox, ElLoading } from 'element-plus'

import {
  associationExport,
  cityBack,
  dataAssociation, downSealSignImage,
  getCodeInfo, getSealInfo, getSealSignList, getSealSignPdf,
  listApprove, minFeiExport,
  postApprove,
  saveSeal,
  updateSeal
} from '@/views/yearCheck/ykb/otherApi'
import { useUserStore } from '@/store'

import checkStep from './components/checkStep.vue'
import pageHeader from './other/pageheader.vue'
import pageFooter from './other/pagefooter.vue'
import yearlyInfo from './other/yearlyInfo.vue'
import sttable1 from './st/sttable1.vue'
import sttable2 from './st/sttable2.vue'
import sttable3 from './st/sttable3.vue'
import sttable4 from './st/sttable4.vue'
import sttable5 from './st/sttable5.vue'
import sttable6 from './st/sttable6.vue'
import sttable7 from './st/sttable7.vue'
import sttable8 from './st/sttable8.vue'
import sttable9 from './st/sttable9.vue'
import sttable10 from './st/sttable10.vue'
import sttable11 from './st/sttable11.vue'
import sttable12 from './st/sttable12.vue'
import sttable13 from './st/sttable13.vue'
import sttable14 from './st/sttable14.vue'
import sttable15 from './st/sttable15.vue'
import sttable16 from './st/sttable16.vue'
import sttable17 from './st/sttable17.vue'
import sttable18 from './st/sttable18.vue'
import sttable19 from './st/sttable19.vue'
import sttable20 from './st/sttable20.vue'
import sttable21 from './st/sttable21.vue'
import sttable22 from './st/sttable22.vue'
import sttable23 from './st/sttable23.vue'

import tablemf0 from './mf/table0.vue'
import tablemf1 from './mf/table1.vue'
import tablemf2 from './mf/table2.vue'
import tablemf3 from './mf/table3.vue'
import tablemf4 from './mf/table4.vue'
import tablemf5 from './mf/table5.vue'
import tablemf6 from './mf/table6.vue'
import tablemf7 from './mf/table7.vue'
import tablemf8 from './mf/table8.vue'
import tablemf9 from './mf/table9.vue'
import tablemf10 from './mf/table10.vue'
import tablemf11 from './mf/table11.vue'
import tablemf12 from './mf/table12.vue'
import tablemf13 from './mf/table13.vue'
import tablemf14 from './mf/table14.vue'
import tablemf15 from './mf/table15.vue'
import tablemf16 from './mf/table16.vue'
import tablemf17 from './mf/table17.vue'
import tablemf18 from './mf/table18.vue'
import tablemf19 from './mf/table19.vue'
import tablemf20 from './mf/table20.vue'
import tablemf21 from './mf/table21.vue'
import tablemf22 from './mf/table22.vue'
import tablemf23 from './mf/table23.vue'
import tablemf24 from './mf/table24.vue'
import { getGCheckStep } from '@/api/yearCheck'
import { wrapperLoadViteEnv } from '~/build/utils'
import { saveAs } from 'file-saver'

export default {
  computed: {
    List() {
      return List
    },
    DocumentCopy() {
      return DocumentCopy
    },
    Checked() {
      return Checked
    },
    Promotion() {
      return Promotion
    }
  },
  components: {
    yearlyInfo,
    checkStep,
    pageHeader,
    pageFooter,
    sttable1,
    sttable2,
    sttable3,
    sttable4,
    sttable5,
    sttable6,
    sttable7,
    sttable8,
    sttable9,
    sttable10,
    sttable11,
    sttable12,
    sttable13,
    sttable14,
    sttable15,
    sttable16,
    sttable17,
    sttable18,
    sttable19,
    sttable20,
    sttable21,
    sttable22,
    sttable23,
    tablemf0,
    tablemf1,
    tablemf2,
    tablemf3,
    tablemf4,
    tablemf5,
    tablemf6,
    tablemf7,
    tablemf8,
    tablemf9,
    tablemf10,
    tablemf11,
    tablemf12,
    tablemf13,
    tablemf14,
    tablemf15,
    tablemf16,
    tablemf17,
    tablemf18,
    tablemf19,
    tablemf20,
    tablemf21,
    tablemf22,
    tablemf23,
    tablemf24
  },
  data() {
    return {
      sealToken:'n6gwoUvlZ7',
      sealSecret:'rn37VMZiS16SanufnyXurMFyNmPJ0i',
      mAuthenticationMessage:'未知，请到签章平台认证或查看认证结果',
      isAuthentication:-1,//-1未认证 0认证中 1认证通过
      isFromBookmark: false,
      sealSilentState: false,
      silentSeal: {
        sealMultipleRequest: { sealIds: '' },
        authUser: { mobile: '' },
        authInformation: ['AUTHORIZE_SEAL'],
        authEndDate: '2050-12-31 23:59:59',
        authTimeModifiable: true,
        authScope: '社会组织年检签章',
        authScopeModifiable: true,
        authorizedMode: ['PINAUTH']
      },
      postSeal: {
        orgId: '',
        orgName: '',
        personContact: '',
        sealPassword: '',
        fileType: 'png',
        fileWidth: undefined,
        fileHeight: undefined,
        base64Str: undefined,
        fileTitle: '年检封面',
        sealPositionSize: '1',
        purposeText: '社会组织年检盖章',
        fileSubject: '社会组织年检盖章封面',
        expireTime: '',
        endTime: '',
        page: '0',
        offsetX: '0.7',
        offsetY: '0.6'
      },
      yearSeal: {
        orgId: '',
        orgName: '',
        personContact: '18996663938',
        sealPassword: '110551201',
        fileType: 'png',
        fileWidth: undefined,
        fileHeight: undefined,
        base64Str: undefined,
        fileTitle: '年检结果',
        sealPositionSize: '1',
        purposeText: '社会组织年检结果盖章',
        fileSubject: '社会组织年检结果盖章',
        expireTime: '',
        endTime: '',
        page: '0',
        offsetX: '0.64',
        offsetY: '0.6'
      },
      nowDate: '',
      sealPdfUrl: '',
      signForm: {
        sealId: '',
        //负责人联系方式
        personContact: '',
        //印章密码
        sealPassword: '',
        sealPasswordOld: '',
        //负责人编号
        personId: '',
        //负责人名称
        personName: '',
        //签署单位编号
        signatoryId: '',
        //签署单位
        signatoryName: '',
        //印章编号
        signatorySealId: '',
        //流水线编号
        categoryId: '3293897914484806511',
        //流水线
        categoryName: '年检结果确认流程'
      },
      signRules: {
        personContact: [{ required: true, message: '请输入', trigger: 'blur' }],
        sealPassword: [{ required: true, message: '请输入', trigger: 'blur' }],
        sealPasswordOld: [{ required: true, message: '请输入', trigger: 'blur' }],
        personId: [{ required: true, message: '请输入', trigger: 'blur' }],
        personName: [{ required: true, message: '请输入', trigger: 'blur' }],
        signatoryId: [{ required: true, message: '请输入', trigger: 'blur' }],
        signatoryName: [{ required: true, message: '请输入', trigger: 'blur' }],
        signatorySealId: [{ required: true, message: '请输入', trigger: 'blur' }],
        categoryId: [{ required: true, message: '请输入', trigger: 'blur' }],
        categoryName: [{ required: true, message: '请输入', trigger: 'blur' }]
      },
      openPress: false,
      chooseRow: undefined,
      yearlyDialog: false,
      postLoading: false,
      userInfo: undefined,
      yearListApprove: undefined,
      yearApprove: undefined,
      pzDialog: false,
      pzList: [],
      listApproveStatus: '',
      total: 1000,
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        creditCode: '',
        examineYear: localStorage.getItem('examineYear'),
      },
      listApproval: [],
      approveLevel: '',
      userName: undefined,
      legalPerson:undefined,
      tableCode: '0',
      tableName: '基本信息',
      radioType: 1,
      active: 0,
      radioValue: '年检记录',
      defaultProps: {
        children: 'children',
        label: 'label'
      },
      treedata: stTreeData,
      treeDataMf: mfTreeData,
      associationList: undefined,
      associationDialog: false,
      associationState: false,
      updateLoadding: false,
      defaultOpeneds: ['0'],
      exportLoadding:false
    }
  },
  created() {
    document.addEventListener('visibilitychange', this.handleVisibilityChange)
    const userStore = useUserStore()
    this.userInfo = userStore.userInfo;
    this.selectUser()
    this.setNowDate()
    this.getSealList()
    this.isSealSilent()
    this.postSeal.expireTime = (new Date().getFullYear() + 1) + '-12-31';
    this.postSeal.endTime = (new Date().getFullYear() + 1) + '-12-31';
    this.yearSeal.expireTime = (new Date().getFullYear() + 1) + '-12-31';
    this.yearSeal.endTime = (new Date().getFullYear() + 1) + '-12-31';
  },
  destroyed() {
    // 移除监听
    document.removeEventListener('visibilitychange', this.handleVisibilityChange)
  },
  mounted() {
    console.log('mounted')
    this.initScreen()
    window.onresize = () => {
      return (() => {
        this.initScreen()
      })()
    }
  },
  methods: {
    handleVisibilityChange() {
      if (!document.hidden) {
        // 如果页面变为可见，且之前是隐藏的，则判断为从书签返回
        if (this.isFromBookmark) {
          // 执行需要的操作
          console.log('从书签返回当前页面')
          this.isSealSilent()
          this.getSignInfo(this.userInfo.userName);
          this.getSealList();
        }
      } else {
        // 如果页面变为不可见，设置isFromBookmark为true
        this.isFromBookmark = true
      }
    },
    companysignsilent() {
      if (this.silentSeal.authUser.mobile == '') {
        this.$message({
          message: '请填写负责人手机号开始授权！',
          type: 'warning'
        })
        return
      }
      let timestamp = new Date().getTime()
      let signature = md5(this.sealToken + this.sealSecret + timestamp)
      axios({
        method: 'post',
        url: 'https://mzj.zgdxyyfgs.com:8000/seal/seal/customParam/cert/user/charge',
        headers: {
          'Content-Type': 'application/json',
          'Accept': 'application/json',
          'x-qys-accesstoken': this.sealToken,
          'x-qys-signature': signature,
          'x-qys-timestamp': timestamp
        },
        data: {
          "userInfoRequest": {
            "contact": this.silentSeal.authUser.mobile
          },
          "companyRequest": {
            "name": this.userInfo.userName
          }
        }
      }).then((res) => {
        let list = res.data.result;
        for (let i = 0; i < list.length; i++) {
          if(list[i].departmentName == this.userInfo.userName || list[i].ownerName == this.userInfo.userName){
            this.signForm.personId = list[i].creatorId;
            this.signForm.signatoryId = list[i].owner;
            this.signForm.signatorySealId = list[i].id;
            this.silentSeal.sealMultipleRequest.sealIds =  list[i].id;
            this.openUrl();
          }
        }
      }, (err) => {
        console.log(err)
      })


    },
    openUrl(){
      let timestamp = new Date().getTime()
      let signature = md5(this.sealToken + this.sealSecret + timestamp)
      axios({
        method: 'post',
        url: 'https://mzj.zgdxyyfgs.com:8000/seal/v2/auth/companysignsilent/url',
        headers: {
          'Content-Type': 'application/json',
          'Accept': 'application/json',
          'x-qys-accesstoken': this.sealToken,
          'x-qys-signature': signature,
          'x-qys-timestamp': timestamp
        },
        data: this.silentSeal
      }).then((res) => {
        if (res.data.code != 0) {
          this.$message({
            message: res.data.message,
            type: 'error'
          })
        } else {
          // window.location.href = res.data.result.url;
          window.open(res.data.result.url, '_blank')
        }
      }, (err) => {
        console.log(err)
      })
    },
    getPersonId(phone){
      let timestamp = new Date().getTime()
      let signature = md5(this.sealToken + this.sealSecret + timestamp)
      axios({
        method: 'post',
        url: 'https://mzj.zgdxyyfgs.com:8000/seal/seal/customParam/cert/user/charge',
        headers: {
          'Content-Type': 'application/json',
          'Accept': 'application/json',
          'x-qys-accesstoken': this.sealToken,
          'x-qys-signature': signature,
          'x-qys-timestamp': timestamp
        },
        data: {
          "userInfoRequest": {
            "contact": phone
          },
          "companyRequest": {
              "name": this.userInfo.userName,
              "registerNo":this.userInfo.workNo
          }
        }
      }).then((res) => {
        let list = res.data.result;
        for (let i = 0; i < list.length; i++) {
          if(list[i].departmentName == this.userInfo.userName || list[i].ownerName == this.userInfo.userName){
            this.signForm.personId = list[i].creatorId;
            this.signForm.signatoryId = list[i].owner;
            this.signForm.signatorySealId = list[i].id;
            this.silentSeal.sealMultipleRequest.sealIds =  list[i].id;
          }
        }
      }, (err) => {
        console.log(err)
      })
    },
    companySealStatus() {
      const formData = new FormData();
      formData.append('registerNo',this.userInfo.workNo)
      let timestamp = new Date().getTime()
      let signature = md5(this.sealToken + this.sealSecret + timestamp)
      axios.post('https://mzj.zgdxyyfgs.com:8000/seal/companyauth/status', formData, {
        headers: {
          'Content-Type': 'multipart/form-data',
          'Accept': 'application/json',
          'x-qys-accesstoken': this.sealToken,
          'x-qys-signature': signature,
          'x-qys-timestamp': timestamp,
        }
      })
        .then(response => {
          console.log('上传成功', response);
          if(response.data.code == 0){
            this.isAuthentication = 0;
            if(response.data.result.result.status == 'AUTH_PASSED'){
              this.isAuthentication = 1;
            }else if(response.data.result.result.status == 'BASE_INFO_UNSUBMIT'){
              this.mAuthenticationMessage = "法人单位基本信息未提交";
            }else if(response.data.result.result.status == 'BASE_INFO_APPLIED'){
              this.mAuthenticationMessage = "法人单位基本信息已提交";
            }else if(response.data.result.result.status == 'BASE_INFO_PASSED'){
              this.mAuthenticationMessage = "法人单位基本信息审核通过";
            }else if(response.data.result.result.status == 'BASE_INFO_REJECT'){
              this.mAuthenticationMessage = "法人单位基本信息审核失败";
            }else if(response.data.result.result.status == 'LP_APPLIED'){
              this.mAuthenticationMessage = "等待法人在线签署";
            }else if(response.data.result.result.status == 'SEAL_AUTH_APPLIED'){
              this.mAuthenticationMessage = "组织机构认证授权书已提交";
            }else if(response.data.result.result.status == 'SEAL_AUTH_PASSED'){
              this.mAuthenticationMessage = "组织机构认证授权书已通过";
            }else if(response.data.result.result.status == 'SEAL_AUTH_REJECT'){
              this.mAuthenticationMessage = "组织机构认证授权书已拒绝";
            }else if(response.data.result.result.status == 'ACCOUNT_INFO_WAIT'){
              this.mAuthenticationMessage = "反向打款待打款";
            }else if(response.data.result.result.status == 'ACCOUNT_INFO_PAYING'){
              this.mAuthenticationMessage = "反向打款银行打款处理中";
            }else if(response.data.result.result.status == 'ACCOUNT_INFO_SUBMIT'){
              this.mAuthenticationMessage = "反向打款信息已提交";
            }else if(response.data.result.result.status == 'ACCOUNT_INFO_REJECT'){
              this.mAuthenticationMessage = "反向打款银行打款处理中";
            }else if(response.data.result.result.status == 'ACCOUNT_INFO_SUCCESS'){
              this.mAuthenticationMessage = "反向打款成功";
            }else if(response.data.result.result.status == 'CANCELLED'){
              this.mAuthenticationMessage = "取消认证授权";
            }
          }else{
            this.isAuthentication = -1;
            this.mAuthenticationMessage = response.data.message;
          }
        })
        .catch(error => {
          this.$message({
            message: '查询认证信息失败！',
            type: 'error'
          })
        });
    },
    isSealSilent() {
      let timestamp = new Date().getTime()
      let signature = md5(this.sealToken + this.sealSecret + timestamp)
      axios({
        method: 'post',
        url: 'https://mzj.zgdxyyfgs.com:8000/seal/v2/auth/signsilent/company/record',
        headers: {
          'Content-Type': 'application/json',
          'Accept': 'application/json',
          'x-qys-accesstoken': this.sealToken,
          'x-qys-signature': signature,
          'x-qys-timestamp': timestamp
        },
        data: { authCompany: { registerNo: this.userInfo.workNo } }
      }).then((res) => {
        console.log(res.data)
        if (res.data.code == 0) {
          if(res.data.result.length > 0){
            this.sealSilentState = true
          }else{
            this.sealSilentState = false
          }
        } else {
          this.sealSilentState = false
        }
      }, (err) => {
        console.log(err)
      })
      this.companySealStatus();
    },
    setNowDate() {
      let currentDate = new Date()
      let year = currentDate.getFullYear()
      let month = String(currentDate.getMonth() + 1).padStart(2, '0')
      let day = String(currentDate.getDate()).padStart(2, '0')
      this.nowDate = year + ' 年 ' + month + ' 月 ' + day + ' 日'
    },
    getSignInfo(name) {
      getSealInfo({ signatoryName: name }).then(response => {
        this.signForm.signatoryName = name
        if (response.data.rows.length != 0) {
          for (let i = 0; i < response.data.rows.length; i++) {
            if (response.data.rows[i].signatoryName == this.signForm.signatoryName) {
              this.signForm = response.data.rows[i]
            }
          }
        }
      })
    },
    initScreen() {
      const winWidth = window.innerWidth
      const winHeight = window.innerHeight
      const size = winWidth / 1920
      if (winWidth > 768 && winWidth < 1850) {
        console.log(size)
        document.body.style.zoom = size
        // document.body.style.zoom = Math.floor(size * 100) + '%'; //放大缩小相应倍数
        // document.body.style.transform = 'scaleX(' + size + ')';
      }
    },
    btnBack() {
      history.back()
    },
    saveSign() {
      this.$refs.signRef.validate(valid1 => {
        if (valid1) {
          this.signForm.categoryId = '3293897914484806511'
          this.signForm.categoryName = '年检结果确认流程'
          console.log(this.signForm)
          if (this.signForm.sealId == '') {
            if (this.signForm.sealPassword != this.signForm.sealPasswordOld) {
              this.$message({
                message: '两次密码输入不一致！',
                type: 'error'
              })
              return
            }
            saveSeal(this.signForm).then(response => {
              console.log(response)
              this.$message({
                message: '保存签章信息成功！',
                type: 'success'
              })
              this.postSeal.personContact = this.signForm.personContact;
              this.postSeal.sealPassword = this.signForm.sealPassword;
              this.getSignInfo(this.signForm.signatoryName)
            })
          } else {
            this.signForm.categoryId = '3293897914484806511'
            this.signForm.categoryName = '年检结果确认流程'
            console.log(this.signForm)
            updateSeal(this.signForm).then(response => {
              console.log(response)
              this.$message({
                message: '修改签章信息成功！',
                type: 'success'
              })
              this.postSeal.personContact = this.signForm.personContact;
              this.postSeal.sealPassword = this.signForm.sealPassword;
            })
          }
        } else {
          console.log(this.signForm)
          this.$message({
            message: '请填写完整！',
            type: 'error'
          })
        }
      })
    },
    signInfo() {
      const content = document.getElementById('signCoverDiv')
      const pdf = new jsPDF()
      html2canvas(content, { scale: 1, fontScale: 1 }).then(canvas => {
        // 将canvas转换为图片
        const imgData = canvas.toDataURL('image/png')
        console.log(imgData)
        //添加图像到PDF
        // const imgProps= pdf.getImageProperties(imgData);
        // const pdfWidth = pdf.internal.pageSize.getWidth();
        // const pdfHeight = (imgProps.height * pdfWidth) / imgProps.width;
        // pdf.addImage(imgData, 'PNG', 0, 0, pdfWidth, pdfHeight);
        // pdf.save('div-content.pdf');
        // let pdfDataBase64 = pdf.output('datauristring') // 获取base64Pdf
        // return;
        const loading = ElLoading.service({
          lock: true,
          text: '请稍后...',
          background: 'rgba(0, 0, 0, 0.6)'
        })
        this.postSeal.base64Str = imgData
        this.postSeal.orgId = this.userInfo.workNo
        this.postSeal.orgName = this.userInfo.userName
        getSealSignPdf(this.postSeal).then(response => {
          loading.close()
          console.log(response.message)
          this.getSealList()
        }).catch((error) => {
          loading.close()
        })
      })
    },
    getSealList() {
      let param = {
        pageNum: 1,
        pageSize: 99,
        orgId: this.userInfo.workNo,
        year: Number(localStorage.getItem('examineYear')) + 1
      }
      getSealSignList(param).then(response => {
        for (let i = 0; i < response.data.rows.length; i++) {
          if (response.data.rows[i].fileTitle != '年检封面') {
            response.data.rows.splice(i, 1);
            i--;
          }
        }
        if (response.data.rows.length > 0) {
          this.getSealLDownLoad(response.data.rows[response.data.rows.length - 1].contractId)
        }
      })
    },
    getSealLDownLoad(contractId) {
      let param = { contractId: contractId }
      const viteEnv = wrapperLoadViteEnv(import.meta.env)
      axios({
        method: 'post',
        url: viteEnv.VITE_BASE_URL_API + 'hbsys-system/sorg/seal/image',
        headers: {
          Authorization: 'Bearer ' + db.get('token') // 如果需要身份验证，可以在这里添加token
        },
        responseType: 'blob',
        data: param
      }).then((res) => {
        console.log(res)
        if (res.data.size == 0) {
          return
        }
        const blob = new Blob([res.data], { type: 'image/jpeg' }) // 创建Blob对象
        this.sealPdfUrl = URL.createObjectURL(blob) // 创建Blob URL
      }, (err) => {
        console.log(err)
      })
    },
    radioTypeChange(index) {
      console.log(index)
      this.active = index
      if (index == 1) {
        this.tableCode = 0;
        this.setTableInfo()
      }else if(index == 0){
        this.getListApprove();
      }
    },
    handleOpen(index, indexPath) {
      console.log('二级菜单项被点击:', index, indexPath)
      this.defaultOpeneds = [index]
    },
    getCheckStep(id) {
      getGCheckStep(id).then(res => {
        console.log(res.data)
      })
    },
    handlePzClick(annotations) {
      console.log(annotations)
      if (annotations == null || annotations.length == 0) {
        this.$message({
          message: '暂无批注！',
          type: 'info'
        })
        return
      }
      this.pzDialog = true
      this.pzList = annotations
    },
    approveInfoClick(info) {
      this.chooseRow = info
      this.openPress = true
    },
    selectUser() {
      console.log(this.userInfo)
      getCodeInfo({ 'creditCode': this.userInfo.workNo }).then(response => {
        console.log(response.data)
        let sorgInfo = response.data.sorgInfo
        if (sorgInfo == null || sorgInfo == '') {
          ElMessageBox.confirm(
            '您的账号没有在民政局社会组织名单内，请联系民政局！',
            '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '退出',
            type: 'warning'
          }
          )
            .then(() => {
              const userStore = useUserStore()
              userStore.logout()
              location.reload()
            })
            .catch(() => {
              const userStore = useUserStore()
              userStore.logout()
              location.reload()
            })
          return
        }
        this.yearListApprove = response.data.inspect
        // for (let i = 0; i < this.yearListApprove.length; i++) {
        //   if (this.yearListApprove[i].approveStatus == null) {
        //     this.yearListApprove.splice(i, 1)
        //     i--
        //   }
        // }
        this.userName = sorgInfo.orgName
        this.legalPerson = sorgInfo.legalPerson
        this.getSignInfo(sorgInfo.orgName)
        localStorage.setItem('userName', sorgInfo.orgName)
        localStorage.setItem('creditCode', sorgInfo.socialCode)
        localStorage.setItem('address', sorgInfo.address)
        localStorage.setItem('examineYear', this.userInfo.year)
        localStorage.setItem('userType', sorgInfo.types)
        //1社会团体 其他是民非
        // this.radioType = 1
        if (sorgInfo.types == '1') {
          this.radioType = 1
        } else {
          this.radioType = 2
        }
        this.getListApprove()
      })
    },
    yearlyList(row) {
      this.yearApprove = row
      this.yearlyDialog = true
    },
    exportData(row){
      //organizationType 1社团  其他民非
      let param = {creditCode:row.creditCode,examineYear:row.examineYear};
      const viteEnv = wrapperLoadViteEnv(import.meta.env)
      this.exportLoadding = true;
      if(row.organizationType == 1){
        console.log(viteEnv.VITE_BASE_URL_API)
        axios({
          method: 'post',
           url: viteEnv.VITE_BASE_URL_API + 'hbsys-system/inspectionResults/associationExport',
          headers: {
            Authorization: 'Bearer ' + db.get('token') // 如果需要身份验证，可以在这里添加token
          },
          responseType: 'blob',
          params: param
        }).then((res) => {
          console.log(res)
          this.exportLoadding = false;
          if (res.data.size == 0) {
            return
          }
          const blob = new Blob([res.data], { type: 'application/pdf' }) // 创建Blob对象
          const pdfUrl = URL.createObjectURL(blob) // 创建Blob URL
          saveAs(pdfUrl, row.examineYear + '年检资料.pdf')
        }, (err) => {
          console.log(err)
          this.exportLoadding = false;
        })
      }else{
        axios({
          method: 'post',
          url: viteEnv.VITE_BASE_URL_API + 'hbsys-system/inspectionResults/minFeiExport',
          headers: {
            Authorization: 'Bearer ' + db.get('token') // 如果需要身份验证，可以在这里添加token
          },
          responseType: 'blob',
          params: param
        }).then((res) => {
          console.log(res)
          this.exportLoadding = false;
          if (res.data.size == 0) {
            return
          }
          const blob = new Blob([res.data], { type: 'application/pdf' }) // 创建Blob对象
          const pdfUrl = URL.createObjectURL(blob) // 创建Blob URL
          saveAs(pdfUrl, row.examineYear + '年检资料.pdf')
        }, (err) => {
          console.log(err)
          this.exportLoadding = false;
        })
      }
    },
    dataTest() {
      if (this.listApproval == null || this.listApproval.length == 0) {
        this.$message({
          message: '没有年检记录，无法提交审核！',
          type: 'warning'
        })
        return
      }
      let param = {
        'creditCode': localStorage.getItem('creditCode'),
        'examineYear': localStorage.getItem('examineYear')
      }
      dataAssociation(param).then(response => {
        this.associationList = response.data
        if (this.associationList == null || this.associationList.length == 0) {
          this.associationState = true
        } else {
          this.associationState = false
        }
        this.associationDialog = true
      })
    },
    postApprove() {
      // if (this.signForm.sealId == '') {
      //   this.$message({
      //     message: '请完善签章信息后再提交！',
      //     type: 'error'
      //   })
      //   return
      // }
      let param = {
        'creditCode': localStorage.getItem('creditCode'),
        'examineYear': localStorage.getItem('examineYear')
      }
      postApprove(param).then(response => {
        if (response.code == 200) {
          this.$message({
            message: '提交审核成功！',
            type: 'success'
          })
          this.associationDialog = false;
          this.getListApprove()
        }
      })
    },
    menuListClick(code, value) {
      this.tableCode = code
      this.tableName = value
      this.setTableInfo()
    },
    handleBack() {
      window.history.back()
    },
    handleStepClick(index) {
      this.active = index
      if (index == 3) {
        this.getListApprove()
      } else if (index == 1) {
        this.tableCode = 0;
        this.setTableInfo()
      } else if (index == 0) {
        this.radioValue = '年检记录'
      }
    },
    topPages() {
      if (this.tableCode == 0) {
        return
      }
      if (this.approveLevel == 0 || this.approveLevel == '') {
        this.tableSave()
      }
      this.tableCode--
      if (this.radioType == 1) {
        let list = this.findNodeById(this.treedata, this.tableCode)
        this.tableName = list.label
      } else {
        let list = this.findNodeById(this.treeDataMf, this.tableCode)
        this.tableName = list.label
      }
      this.setTableInfo()
    },
    nextPages() {
      if (this.tableCode == 24) {
        return
      }
      if (this.approveLevel == 0 || this.approveLevel == '') {
        this.tableSave()
      }
      this.tableCode++
      if (this.radioType == 1) {
        let list = this.findNodeById(this.treedata, this.tableCode)
        this.tableName = list.label
      } else {
        let list = this.findNodeById(this.treeDataMf, this.tableCode)
        this.tableName = list.label
      }
      this.setTableInfo()
    },
    findNodeById(tree, value) {
      // 遍历当前层级的所有节点
      for (let i = 0; i < tree.length; i++) {
        let node = tree[i]
        // 如果当前节点的 ID 匹配目标节点的 ID，则返回当前节点
        console.log(node.value, value)
        if (node.value == value) {
          return node
        }
        // 如果当前节点有子节点，则递归调用当前函数继续查找子节点
        if (node.children && node.children.length > 0) {
          let foundNode = this.findNodeById(node.children, value)
          // 如果在子节点中找到了目标节点，则返回找到的节点
          if (foundNode) {
            return foundNode
          }
        }
      }
      // 如果遍历完所有节点仍未找到目标节点，则返回 null
      return null
    },

    getListApprove() {
      this.queryParams.creditCode = localStorage.getItem('creditCode')
      this.queryParams.examineYear = localStorage.getItem('examineYear')
      listApprove(this.queryParams).then(response => {
        this.listApproval = JSON.parse(JSON.stringify(response.rows).replace(/null/g, '""'))
        if (this.listApproval != '' && this.listApproval.length != 0) {
          this.approveLevel = this.listApproval[0].approveLevel
          this.listApproveStatus = this.listApproval[0].approveStatus
          this.getCheckStep(this.listApproval[0].id)
        } else {
          this.listApproveStatus = ''
        }
        this.total = response.total
      })
    },
    setTableInfo() {
      if (this.radioType == '1') {
        switch (Number(this.tableCode)) {
          case 0:
            setTimeout(() => {
              this.$refs.sttable1.getInfo()
            }, 5000)
            break
          case 1:
            this.$refs.sttable2.getInfo()
            break
          case 2:
            this.$refs.sttable3.getInfo()
            break
          case 3:
            this.$refs.sttable4.getInfo()
            break
          case 4:
            this.$refs.sttable5.getInfo()
            break
          case 5:
            this.$refs.sttable6.getInfo()
            break
          case 6:
            this.$refs.sttable7.getInfo()
            break
          case 7:
            this.$refs.sttable8.getInfo()
            break
          case 8:
            this.$refs.sttable9.getInfo()
            break
          case 9:
            this.$refs.sttable10.getInfo()
            break
          case 10:
            this.$refs.sttable11.getInfo()
            break
          case 11:
            this.$refs.sttable12.getInfo()
            break
          case 12:
            this.$refs.sttable13.getInfo()
            break
          case 13:
            this.$refs.sttable14.getInfo()
            break
          case 14:
            this.$refs.sttable15.getInfo()
            break
          case 15:
            this.$refs.sttable16.getInfo()
            break
          case 16:
            this.$refs.sttable17.getInfo()
            break
          case 17:
            this.$refs.sttable18.getInfo()
            break
          case 18:
            this.$refs.sttable19.getInfo()
            break
          case 19:
            this.$refs.sttable20.getInfo()
            break
          case 20:
            this.$refs.sttable21.getInfo()
            break
          case 21:
            this.$refs.sttable23.getInfo()
            break
          case 22:
            this.$refs.sttable22.getInfo()
            break
        }
      } else {
        switch (Number(this.tableCode)) {
          case 0:
            setTimeout(() => {
              this.$refs.tablemf0.getInfo()
            }, 5000)
            break
          case 1:
            this.$refs.tablemf1.getInfo()
            break
          case 2:
            this.$refs.tablemf2.getInfo()
            break
          case 3:
            this.$refs.tablemf3.getInfo()
            break
          case 4:
            this.$refs.tablemf4.getInfo()
            break
          case 5:
            this.$refs.tablemf5.getInfo()
            break
          case 6:
            this.$refs.tablemf6.getInfo()
            break
          case 7:
            this.$refs.tablemf7.getInfo()
            break
          case 8:
            this.$refs.tablemf8.getInfo()
            break
          case 9:
            this.$refs.tablemf9.getInfo()
            break
          case 10:
            this.$refs.tablemf10.getInfo()
            break
          case 11:
            this.$refs.tablemf11.getInfo()
            break
          case 12:
            this.$refs.tablemf12.getInfo()
            break
          case 13:
            this.$refs.tablemf19.getInfo()
            break
          case 14:
            this.$refs.tablemf20.getInfo()
            break
          case 15:
            this.$refs.tablemf13.getInfo()
            break
          case 16:
            this.$refs.tablemf14.getInfo()
            break
          case 17:
            this.$refs.tablemf15.getInfo()
            break
          case 18:
            this.$refs.tablemf16.getInfo()
            break
          case 19:
            this.$refs.tablemf17.getInfo()
            break
          case 20:
            this.$refs.tablemf18.getInfo()
            break
          case 21:
            this.$refs.tablemf21.getInfo()
            break
          case 22:
            this.$refs.tablemf22.getInfo()
            break
          case 23:
            this.$refs.tablemf23.getInfo()
            break
          case 24:
            this.$refs.tablemf24.getInfo()
            break
        }
      }
    },
    tableSave() {
      this.postLoading = true
      setTimeout(() => {
        this.postLoading = false
      }, 4000)

      if (this.radioType == '1') {
        switch (Number(this.tableCode)) {
          case 0:
            this.$refs.sttable1.postInfo()
            setTimeout(() => {
              this.getListApprove()
            }, 4000)
            break
          case 1:
            this.$refs.sttable2.postInfo()
            break
          case 2:
            this.$refs.sttable3.postInfo()
            break
          case 3:
            this.$refs.sttable4.postInfo()
            break
          case 4:
            this.$refs.sttable5.postInfo()
            break
          case 5:
            this.$refs.sttable6.postInfo()
            break
          case 6:
            this.$refs.sttable7.postInfo()
            break
          case 7:
            this.$refs.sttable8.postInfo()
            break
          case 8:
            this.$refs.sttable9.postInfo()
            break
          case 9:
            this.$refs.sttable10.postInfo()
            break
          case 10:
            this.$refs.sttable11.postInfo()
            break
          case 11:
            this.$refs.sttable12.postInfo()
            break
          case 12:
            this.$refs.sttable13.postInfo()
            break
          case 13:
            this.$refs.sttable14.postInfo()
            break
          case 14:
            this.$refs.sttable15.postInfo()
            break
          case 15:
            this.$refs.sttable16.postInfo()
            break
          case 16:
            this.$refs.sttable17.postInfo()
            break
          case 17:
            this.$refs.sttable18.postInfo()
            break
          case 18:
            this.$refs.sttable19.postInfo()
            break
          case 19:
            this.$refs.sttable20.postInfo()
            break
          case 20:
            this.$refs.sttable21.postInfo()
            break
          case 21:
            this.$refs.sttable23.postInfo()
            break
          case 22:
            // this.$refs.sttable22.postInfo()
            this.$message({
              message: '保存文件成功！',
              type: 'success'
            })
            break
        }
      } else {
        setTimeout(() => {
          this.postLoading = false
        }, 4000)
        switch (Number(this.tableCode)) {
          case 0:
            this.$refs.tablemf0.postInfo()
            setTimeout(() => {
              this.getListApprove()
            }, 4000)
            break
          case 1:
            this.$refs.tablemf1.postInfo()
            break
          case 2:
            this.$refs.tablemf2.postInfo()
            break
          case 3:
            this.$refs.tablemf3.postInfo()
            break
          case 4:
            this.$refs.tablemf4.postInfo()
            break
          case 5:
            this.$refs.tablemf5.postInfo()
            break
          case 6:
            this.$refs.tablemf6.postInfo()
            break
          case 7:
            this.$refs.tablemf7.postInfo()
            break
          case 8:
            this.$refs.tablemf8.postInfo()
            break
          case 9:
            this.$refs.tablemf9.postInfo()
            break
          case 10:
            this.$refs.tablemf10.postInfo()
            break
          case 11:
            this.$refs.tablemf11.postInfo()
            break
          case 12:
            this.$refs.tablemf12.postInfo()
            break
          case 13:
            this.$refs.tablemf19.postInfo()
            break
          case 14:
            this.$refs.tablemf20.postInfo()
            break
          case 15:
            this.$refs.tablemf13.postInfo()
            break
          case 16:
            break
          case 17:
            this.$refs.tablemf15.postInfo()
            break
          case 18:
            this.$refs.tablemf16.postInfo()
            break
          case 19:
            this.$refs.tablemf17.postInfo()
            break
          case 20:
            this.$refs.tablemf18.postInfo()
            break
          case 21:
            this.$refs.tablemf21.postInfo()
            break
          case 22:
            this.$refs.tablemf22.postInfo()
            break
          case 23:
            this.$refs.tablemf23.postInfo()
            break
          case 24:
            // this.$refs.tablemf24.postInfo()
            this.$message({
              message: '保存文件成功！',
              type: 'success'
            })
            break
        }
      }

    }
  }
}
// let file = this.dataURLtoFile(pdfData, '封面.pdf') // 将base64文件转化为流，上传oss
// console.log(file)
// const formData = new FormData()
// formData.append('file', file);
//
// const xhr = new XMLHttpRequest();
// // 配置请求
// const viteEnv = wrapperLoadViteEnv(import.meta.env)
// xhr.open('POST', viteEnv.VITE_BASE_URL_API + 'hbsys-system/minio/upload', true);
// // 监听上传进度事件
// xhr.upload.onprogress = function(event) {
//   if (event.lengthComputable) {
//     const percentComplete = (event.loaded / event.total) * 100;
//     console.log(`上传进度：${percentComplete.toFixed(2)}%`);
//   }
// };
// // 请求完成事件
// xhr.onload = function() {
//   if (this.status === 200) {
//     const response = xhr.responseText;
//     console.log('服务器响应:', response);
//     loading.close()
//   } else {
//     console.log('请求出错，状态码:', xhr.status);
//   }
// };
// // 发送请求
// xhr.send(formData);
// const blob = new Blob([res.data], { type: 'application/zip,charset=utf-8' }) // 创建Blob对象
// let files = new window.File([blob], '电子签章.zip', { type: 'zip' })
// JSZip.loadAsync(files).then((zip) => {
//   for (let key in zip.files) {
//     // 用blob的格式读取，方便后面下载到本地
//     let base = zip.file(zip.files[key].name).async('blob')
//     if (zip.files[key].name.indexOf('封面') >= 0) {
//       base.then(res => {
//         const reader = new FileReader();
//         reader.onload = (event) => {
//           const base64Pdf = event.target.result;
//           const index = base64Pdf.indexOf('base64,');
//           if(index != -1){
//             console.log(base64Pdf.slice(index + 7));
//             this.sealPdfUrl = base64Pdf.slice(index + 7);
//           }
//         };
//         console.log(new Blob([res]))
//         reader.readAsDataURL(new Blob([res]));
//       })
//     }
//   }
// })
</script>
<style scoped lang="scss">
#app {
  height: 200vh !important;
}

.el-table {
  --el-table-row-hover-bg-color: rgba(39, 137, 238, 0.1);
  --el-table-border-color: #e0e5f0;
}

:deep(.el-card.is-always-shadow) {
  box-shadow: 0 1px 14px 0 rgba(209, 224, 239, 0.6)
}

/* 拉框选中 */
.el-select-dropdown__item {
  height: 24px;
  line-height: 24px;
  font-size: 12px;
}

/* 鼠标经过下拉框 */
.el-select-dropdown__item:hover {
  height: 24px;
  line-height: 24px;
  font-size: 12px;
}

.el-select-dropdown__item.selected {
  color: #2789EE;
}

body {
  padding: 0px;
  margin: 0px;
}

.el-card {
  --el-card-padding: 1px;
}

.app-container {
  width: 100%;
}

.bgyearly {
  //background-image: url('@/assets/imgs/zxbg2.jpg');
  background-size: cover;
  width: 100%;
  box-sizing: border-box;
}

.div-bg {
  width: 100%;
  background: #F0F0F0;
  height: 10px;
}

.box-card {
  padding: 20px;
  box-sizing: border-box;
}

.el-col {
  padding-left: 5px;
}

.divider-title {
  font-weight: bold;
  font-size: 18px;
}

.custom-select .el-select-dropdown {
  max-height: 600px;
  /* 设置为你想要的高度 */
  overflow: auto;
  /* 添加滚动条 */
}

table {
  border-collapse: collapse;
  /* 确保表格的边框合并为单一边框 */
  width: 100%;
  /* 表格宽度 */
}

td {
  border: 1px solid #ababab;
  /* 设置单线边框 */
  padding: 4px;
  /* 单元格内边距 */
}

.footer-title {
  padding-top: 20px;
  width: 100%;
  text-align: center;
  font-family: Source Han Sans SC, Source Han Sans SC;
  font-weight: 400;
  font-size: 16px;
  color: #999999;
  cursor: pointer;
}

.footer-item {
  width: 100%;
  font-family: Source Han Sans SC, Source Han Sans SC;
  font-weight: 400;
  font-size: 16px;
  color: #333333;
  text-align: center;
  margin-bottom: 6px;
  cursor: pointer;

  img {
    width: 20px;
    height: 20px;
  }
}

.footer-item:last-child {
  margin-bottom: 0;
}

.p-title {
  padding: 10px;
}

.btnbg {
  border-left: 1px solid white;
  margin-left: 30px;
  padding-left: 10px;
  height: 30px;
}

.el-form-item {
  margin-bottom: 0px;
}

.sign-bg {
  height: 60px;
  /* 设置div高度 */
  line-height: 60px;
  width: 200px;
  border-radius: 8px;
  border: 6px solid #e53636;
  /* 设置边框，便于观察 */
  color: #e53636;
  font-size: 30px;
  font-weight: bold;
  margin-top: 20px;
  margin-left: 150px;
}

.txt-year {
  text-align: center;
  line-height: 50px;
  font-size: 22px;
  color: #6e1316;
  border-bottom: 1px solid gray;

}

.col2 {
  padding-top: 30px;
  text-align: center;
  padding-bottom: 20px;
}

.no-padding {
  padding: 0 !important;
  /* 使用 !important 来确保覆盖默认样式 */
}

:deep(.el-menu-item) {
  display: flex !important;
  align-items: center !important;
  text-align: right !important;
  height: auto !important;
  line-height: 18px !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  font-size: 14px !important;
  margin-left: -10px !important;
}

:deep(.el-sub-menu__title) {
  display: flex;
  align-items: center;
  text-align: right;
  height: 44px;
  line-height: 20px;
  font-size: 14px;
}

:deep(.el-card.is-always-shadow) {
  box-shadow: 0 1px 14px 0 rgba(209, 224, 239, 0.6)
}

.p-dian {
  margin-right: 10px;
}

.selectedColor {
  color: #0C7CFF;
  white-space: pre-wrap;
  text-align: left;
}

.selectColor {
  color: #333333;
  white-space: pre-wrap;
  text-align: left;
}

.headImage {
  background-image: url('assets/headimage.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  width: 100%;
  height: 200px;
}

.menuSelected {
  color: #0c7cff;
  font-weight: bold;
  border-bottom: 3px solid #0c7cff;
  font-size: 20px;
  height: 40px;
  text-align: center;
  cursor: pointer;
  padding-left: 5px;
  padding-right: 5px;
}

.menuSelect {
  color: #000000;
  font-size: 20px;
  height: 40px;
  text-align: center;
  cursor: pointer;
  padding-left: 5px;
  padding-right: 5px;
}

.menuSelect:hover {
  color: #0c7cff;
  font-weight: bold;
  border-bottom: 3px solid #0c7cff;
  font-size: 20px;
  height: 40px;
  text-align: center;
  cursor: pointer;
  padding-left: 5px;
  padding-right: 5px;
}
</style>
